package com.shop.cloud.model.response;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author Alex
 */
@ToString(callSuper = true)
@EqualsAndHashCode
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler", "fieldHandler" }, ignoreUnknown = true)
public class RestfulResponse implements Response {
	private static final long serialVersionUID = -7443304902819898146L;

	public static final String DEFAULT_SUCCESS = "0";
	public static final String DEFAULT_ERROR = "-1";
	
	public static final String ERROR_SYS_BUSY_MSG = "系统繁忙，请稍后再试！";
	public static final String ERROR_PHONE_ALREADY_REGISTER = "此手机号已注册！";
	public static final String ERROR_PHONE_OR_PASSWORD = "帐号或密码错误！";
	public static final String ERROR_THIRD_PARTY_TYPE = "第三方帐号类型错误！";
	public static final String ERROR_PHONE_NOT_REGISTER = "此手机号未注册！";
	public static final String ERROR_NO_LOGIN = "未登录用户！";
	public static final String ERROR_OLD_PASSWORD = "旧密码错误！";
	public static final String ERROR_USER_NOT_EXIST = "用户不存在！";
	public static final String ERROR_ID_NOT_EXIST = "不存在的id！";
	public static final String ERROR_GET_SHARE_URL = "获取分享链接错误!";
	public static final String ERROR_PHONE_BINDED = "此手机号已绑定了其它帐户!";
	public static final String ERROR_NOT_OPEN_SHOP = "此用户未开店!";
	public static final String ERROR_SIGNED = "今天已签到!";
	public static final String ERROR_GET_CODE = "获取验证码失败!";
	public static final String ERROR_BALANCE_NOT_ENOUGH = "余额不足!";
	public static final String ERROR_ACTIVITY_CANT_ENROLL = "活动已开始或已结束，不能再报名!";
	public static final String ERROR_ILLEGAL_OP = "非法操作!";

	/**
	 * [M] 返回码
	 */
	@JsonProperty("result")
	@ApiModelProperty(value = "返回码", example = "0", required = true)
	private String result = DEFAULT_SUCCESS;
	
	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}
	
	/**
	 * [M] 返回说明
	 */
	@JsonProperty("resultMsg")
	@ApiModelProperty(value = "返回说明", example = "", required = true)
	private String resultMsg = "success";
	
	public String getResultMsg() {
		return resultMsg;
	}

	public void setResultMsg(String resultMsg) {
		this.resultMsg = resultMsg;
	}
}
